const mixin = {
	methods: {
		checkLogin(){
			const token = uni.getStorageSync('token');
			if (!token) {
				this.isLogin = false;
				uni.showModal({
					title: '登录提示',
					content: '暂无登录,是否立即登录',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
							uni.navigateTo({
								url: '/pages/login/login'
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
				return false;
			} else {
				return true;	
			}
		}
	}
}

export default mixin;